//
//  CarDetailsViewController.m
//  UcarTest
//
//  Created by 陈曦 on 16/1/14.
//  Copyright © 2016年 chenxi. All rights reserved.
//

#import "MSSAutoresizeLabelFlowCell2.h"
#import "MSSAutoresizeLabelFlowConfig2.h"

@interface MSSAutoresizeLabelFlowCell2 ()

@property (nonatomic,strong) UILabel *titleLabel;

@end

@implementation MSSAutoresizeLabelFlowCell2

- (UILabel *)titleLabel {
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc]init];
        _titleLabel.backgroundColor = [UIColor clearColor];
        _titleLabel.textColor = [UIColor colorWithRed:0 / 255.0 green:137 / 255.0 blue:225 / 255.0 alpha:1];
        _titleLabel.font = [MSSAutoresizeLabelFlowConfig2 shareConfig].textFont;
        _titleLabel.layer.cornerRadius = [MSSAutoresizeLabelFlowConfig2 shareConfig].itemCornerRaius;
        _titleLabel.layer.borderColor = [UIColor colorWithRed:0 / 255.0 green:137 / 255.0 blue:225 / 255.0 alpha:1].CGColor;
        _titleLabel.layer.borderWidth = 0.5;
        _titleLabel.layer.masksToBounds = YES;
        _titleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _titleLabel;
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self.contentView addSubview:self.titleLabel];
    }
    return self;
}

- (void)configCellWithTitle:(NSString *)title {
    self.titleLabel.frame = self.bounds;
    self.titleLabel.text = title;
}

@end
